import { Tree } from "antd"
import { useComponentStore } from "../../stores/components"


const Outline = () => {
  const { components, setCurComponentId } = useComponentStore()
  return <Tree
    fieldNames={{title: 'desc', key: 'id'}}
    treeData={components as any}
    showLine
    defaultExpandAll
    onSelect={([selectKey]) => {
      setCurComponentId(selectKey as number)
    }}
  />
}

export default Outline